﻿import Rhino.Commons.Facilities
import Rhino.Commons
import Rhino.Security
import Rhino.Security.Interfaces from Rhino.Security

import System.Web.Mvc from System.Web.MVC
import System.Collections.Generic
import System
import System.Reflection

import DomainModel.Abstract
import DomainModel.Concrete
import DomainModel.Services
import DomainModel.Entities

import WebUI from WebUI
import Castle.Core.Interceptor from Castle.Core



def DefineComponents():
  facility RhinoTransactionFacility
  facility RhinoSecurityFacility:
    securityTableStructure = SecurityTableStructure.Prefix
    userType = User
	
	//Component("NHibernate_SchemaGeneration", INHibernateInitializationAware, NHibernateDbSchemaGeneration)
			
  Component("ProdsRepository", IProductsRepository, ProductsRepository)
  Component("UsersRepository", IUserRepository, UserRepository)
  
    //Component("product_service", IEntityService of Product, ProductService)
  myWebAppAssembly = Assembly.Load("WebUI")
  for type in myWebAppAssembly.GetTypes():
      if typeof(IController) != type and typeof(IController).IsAssignableFrom(type):
          Component type.Name, IController, type: lifestyle Transient